package com.bingfor.easycablelink.home.Trends;

import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bingfor.easycablelink.databinding.HomeTrendsItemBinding;

/**
 * Created by LY on 2017/5/19.
 */

public class TrendsAdapter extends  RecyclerView.Adapter<TrendsAdapter.FoodViewHolder> {

    OnMoreOptionClick onMoreOptionClick;

    @Override
    public FoodViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new FoodViewHolder(
                HomeTrendsItemBinding
                        .inflate(LayoutInflater.from(parent.getContext()), parent, false)
                        .getRoot(),
                onMoreOptionClick
        );
    }

    @Override
    public void onBindViewHolder(FoodViewHolder holder, int position) {

        HomeTrendsItemBinding binding = DataBindingUtil.findBinding(holder.itemView);

    }

    @Override
    public int getItemCount(){
        return 10;
    }

    protected static class FoodViewHolder extends RecyclerView.ViewHolder {

        public FoodViewHolder(View itemView, OnMoreOptionClick onMoreOptionClick) {
            super(itemView);

        }
    }

    public void setOnMoreOptionClick( OnMoreOptionClick onMoreOptionClick){
        this.onMoreOptionClick = onMoreOptionClick;
    }

    interface OnMoreOptionClick {
        void showMoreOption(View view, int position);
    }
}

